home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / LinkSrc.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  3.4 KB  |  166 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: LinkSrc.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODLinkSource_xh
  18. #define SOM_ODLinkSource_xh
  19.  
  20. class ODLinkSource;
  21.  
  22. #define ODLinkSource_MajorVersion 1
  23. #define ODLinkSource_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODBaseLinkSource_xh
  31. #include <LinkSrcB.xh>
  32. #endif
  33.  
  34. #ifndef ODLinkSource_API
  35. #define ODLinkSource_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODRefCntObject;
  50. class ODPersistentObject;
  51. class ODStorageUnit;
  52. class ODBaseLinkSource;
  53. class ODPart;
  54. class ODPartList;
  55. class ODLink;
  56. class ODDraft;
  57. class ODLinkSource;
  58.  
  59. /*
  60.  * End of user-defined types.
  61.  */
  62.  
  63. #ifdef OLDIBMSOMAPISUPPORT
  64. #define ODLinkSourceCClassData ODLinkSourceClassData
  65. #define ODLinkSourceNewClass(major,minor) somNewVersionedClassReference(ODLinkSource,major,minor)
  66. #endif
  67.  
  68. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  69. #define ODLinkSourceMetaClass SOMClass
  70.  
  71. #if PRAGMA_ALIGN_SUPPORTED
  72. #  pragma options align=power
  73. #endif
  74.  
  75. /* The API to the ODLinkSource class object, and the methods it introduces. */
  76. SOMEXTERN struct ODLinkSourceClassDataStructure {
  77. #ifdef OLDIBMSOMAPISUPPORT
  78.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  79. #else
  80.     long zero;
  81. #endif
  82.     somStaticClassInfo *sci;
  83.     somDToken        instanceDataToken;
  84.     long reserved [3];
  85.     somMToken reserved1;
  86.     somMToken reserved2;
  87.     somMToken reserved3;
  88.     somMToken reserved4;
  89.     somMToken reserved5;
  90.     somMToken reserved6;
  91.     somMToken reserved7;
  92.     somMToken reserved8;
  93. } SOMDLINK ODLinkSourceClassData;
  94.  
  95. #if PRAGMA_ALIGN_SUPPORTED
  96. #  pragma options align=reset
  97. #endif
  98.  
  99. #if !defined(ODLinkSource_Class_Source) && !defined(SOM_Module_linksrc_Source)
  100. #if PRAGMA_IMPORT_SUPPORTED
  101. #pragma import list ODLinkSourceClassData
  102. #endif
  103. #endif
  104.  
  105.  
  106. /*
  107.  * -- Typedefs and inline method declarations for left path inherited methods
  108.  * -- are omitted because this compilation had -museinheritedmethods in effect
  109.  */
  110.  
  111.  
  112. /*
  113.  * -- Typedefs for ODLinkSource Method Procedures
  114.  */
  115. SOMEXTERN {
  116. }
  117.  
  118. #endif /* ODLinkSource_API */
  119.  
  120.  
  121. /*
  122.  * -- This emitter treats Method Tokens as Thunks by default.
  123.  * -- Use the sc modifier "nothunks" to change this default
  124.  */
  125. #undef somresolve_
  126. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  127.  
  128. /*
  129.  * -- The C++ Wrapper Class for ODLinkSource
  130.  */
  131. class ODLinkSource : public ODBaseLinkSource
  132. {
  133. public:
  134.  
  135. // ODLinkSource::new registers use of the class object, and then uses somNew
  136. // to allocate memory and load the object method table pointer. 
  137. void *operator new(size_t size)
  138. {
  139.     SOM_IgnoreWarning(size);
  140.     // Allocate memory using the default allocator for ODLinkSource, and
  141.     // clear mem & set method table pointer, call basic initialization
  142. #ifdef SOMCHKNULL
  143.     void * __somResult = (void *)
  144.       somNewObject(ODLinkSource);
  145.     SOMCHKNULL(__somResult);
  146.     return __somResult;
  147. #else
  148.     return (void*) somNewObject(ODLinkSource);
  149. #endif
  150. }
  151.  
  152. // ODLinkSource::delete uses the default deallocator for the object's class.
  153. void operator delete(void * obj)
  154. {
  155.     if (obj) {
  156.         SOM_Resolve(obj,SOMObject,somFree)
  157.            ( (SOMObject*) obj );
  158.     }
  159. }
  160.  
  161. };   /* ODLinkSource */
  162.  
  163.  
  164.  
  165. #endif       /* SOM_ODLinkSource_xh */
  166.